<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require dirname(__FILE__).'/pc_controller.php';

class Api_log extends PC_controller {

    public function __construct(){
        parent::__construct();
        $this->load->model('ApiLogmodel','m_api_log',true);
    }

    public function index(){
        $data = parent::index();

        $data['attr'] = array();
        // global $g_terminal_arr;
        // $data['attr']['terminal_arr'] = json_decode(array4js($g_terminal_arr));

        $this->load->view('admin/api_log',$data);
    }

    public function getApiLogList(){
        $assist['where'] = getFilter($this->input->post(),ApiLogmodel::$searchField);
        $assist['like'] = getFilter($this->input->post(),ApiLogmodel::$likeField);
        $assist['sort'] = getSort($this->input->post(),ApiLogmodel::$sortField);
        $assist['pagination'] = getPagination($this->input->post());

        list($list,$count) = $this->m_api_log->getApiLogListSection($assist);
        foreach ($list as $key => $value) {
            $list[$key]['post_data'] = htmlspecialchars($value['post_data']);
        }

        $this->response->setSuccess();
        $this->response->setItems($list);
        $this->response->setTotalCount($count);
        $this->response->responseExit();

    }
}
/* End of file api_log.php */
/* Location: ./application/controllers/api_log.php */
